﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract]
    public class System_MarkManageModel
    {
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        private int _InvolvingPersonID;
        [DataMember]
        public int InvolvingPersonID
        {
            get { return _InvolvingPersonID; }
            set { _InvolvingPersonID = value; }
        }

        private string _InvolvingSubset;
        [DataMember]
        public string InvolvingSubset
        {
            get { return _InvolvingSubset; }
            set { _InvolvingSubset = value; }
        }

        private string _Content;
        [DataMember]
        public string Content
        {
            get { return _Content; }
            set { _Content = value; }
        }

        private string _Operator;
        [DataMember]
        public string Operator
        {
            get { return _Operator; }
            set { _Operator = value; }
        }

        private DateTime? _UpdateDate;
        [DataMember]
        public DateTime? UpdateDate
        {
            get { return _UpdateDate; }
            set { _UpdateDate = value; }
        }

        private string _OPerationStyle;
        [DataMember]
        public string OPerationStyle
        {
            get { return _OPerationStyle; }
            set { _OPerationStyle = value; }
        }

        private string _InvolvingColumn;
        [DataMember]
        public string InvolvingColumn
        {
            get { return _InvolvingColumn; }
            set { _InvolvingColumn = value; }
        }

        private string _OldContent;
        [DataMember]
        public string OldContent
        {
            get { return _OldContent; }
            set { _OldContent = value; }
        }

        private string _EmpName;
        [DataMember]
        public string EmpName
        {
            get { return _EmpName; }
            set { _EmpName = value; }
        }

        public static System_MarkManageModel FillEntity(DataRow dr)
        {
            System_MarkManageModel right = new System_MarkManageModel();
            right.ID = (int)dr["ID"];
            right.InvolvingPersonID = (int)dr["InvolvingPersonID"];
            right.InvolvingSubset = dr["InvolvingSubset"] as string;
            right.Content = dr["Content"] as string;
            right.InvolvingColumn = dr["InvolvingColumn"] as string;
            right.OPerationStyle = dr["OPerationStyle"] as string;
            right.Operator = dr["Operator"] as string;
            right.OldContent = dr["OldContent"] as string;
            right.EmpName = dr["EmpName"] as string;
            right.UpdateDate = (string.IsNullOrEmpty(dr["UpdateDate"].ToString()) || dr["UpdateDate"].ToString() == "1900/1/1 0:00:00") ? null : (DateTime?)dr["UpdateDate"];
            return right;
        }
    }
}
